package applogic0;

import model.User;
import applogic.UserHelper;

public class UserHelper0 implements UserHelper 
{
  private User user;

  @Override
  public void loginAs(User user) 
  {
    if (user.getPassword().equals("wrong"))	{	return;	}
    this.user = user;
  }
  @Override
  public void logout()						{	this.user = null;		}
  @Override
  public boolean isLoggedIn()				{	return user != null;	}
  @Override
  public boolean isLoggedInAs(User user)	{	return isLoggedIn() && this.user.getLogin().equals(user.getLogin());	}
  @Override
  public boolean isNotLoggedIn() 			{	return user == null;	}
}
